{layout name="public/layout" /}

        {include file='yxnavbar'}
<div class="main">
    <ul class="nav nav-tabs">
		<li {if $action < 2}class="active"{/if}><a href="{php echo createWebUrl('shangjia');}">可用商家列表</a></li>
        <li {if $action == 2}class="active"{/if}><a href="{php echo createWebUrl('shangjia', array('action' =>2));}">暂停商家列表</a></li>
        <li {if $action == 3}class="active"{/if}><a href="{php echo createWebUrl('shangjia', array('action' =>3));}">商家报名信息</a></li>
        <li><a href="{php echo createWebUrl('shangjiaadd');}">新增商家</a></li>
        <li {if $action == 4}class="active"{/if}><a href="{php echo createWebUrl('shangjia', array('action' =>4));}">分组管理</a></li>
        <li><a href="{php echo createWebUrl('shangjiagroupadd');}">新增分组</a></li>
    </ul>
    <div class="panel panel-info">
        <div class="panel-heading">当前数量： {$total}</div>
        
    </div>
  <div class="panel panel-default">
    {if $action == 4}
        <div class="panel-body table-responsive"> 
            <table class="table table-hover">
                <thead class="navbar-inner">
                    <tr>
                        <th style="width:50px;">序号</th>
                        <th style="width:120px;">分组名称</th>
                        <th style="width:100px; text-align:right;">操作</th>
                    </tr>
                </thead>
                <tbody>
                    {loop $list $i $item}
                  <tr> 
                    <td>{php echo $i+1+($pageNumber - 1) * $pageSize;}</td>
                    <td>{$item['name']}</td>
                    <td style="text-align:right;">
                      <a class="btn btn-warning btn-sm" href="{php echo createWebUrl('shangjiagroupadd', array('shangjiaid' =>$item['id'],'themeid'=>$themeid));}" title="编辑"><i class="icon-edit"></i>编辑</a>
                      <a href="{php echo createWebUrl('shangjiagroupadd', array('op' => 'delete','themeid'=>$themeid, 'id' => $item['id']));}" style="width: 30px" class="btn btn-danger btn-sm" onclick="if(!confirm('参团记录相关的数据将全被删除，确定删除吗')) return false;"  title="删除" data-toggle="tooltip" data-placement="top"><i class="fa fa-times"> </i></a>
                    </td>
                </tr>
                {/loop}
            </tbody>
            </table>
        </div>
    {else}
        <div class="panel-body table-responsive"> 
            <table class="table table-hover">
                <thead class="navbar-inner">
                    <tr>
                        <th style="width:50px;">序号</th>
                        <th style="width:120px;">名称</th>
                        {if $action !== 3}
                        <th style="width:80px;">管理员密码</th>
                        <th style="width:80px;">员工密码</th>
                        {else}
                        <th style="width:80px;">联系人</th>
                        <th style="width:80px;">电话</th>
                        <th style="width:80px;">地址</th>
                        {/if}
                        <th style="width:100px; text-align:right;">操作</th>
                    </tr>
                </thead>
                <tbody>
                    {loop $list $i $item}
                  <tr> 
                    <td>{php echo $i+1+($pageNumber - 1) * $pageSize;}</td>
                    <td>{$item['name']}</td>
                    {if $action !== 3}
                        <td>管理员密码:<span style="color: #ff0000">{$item['shoppass']}</span></td>
                        <td>员工密码:<span style="color: #ff0000">{$item['workerpass']}</span></td>

                    {else}
                        <td>{$item['content']}</td>
                        <td>{$item['mobile']}</td>
                        <td>{$item['address']}</td>
                    {/if}
                    <td style="text-align:right;">
	                  <a class="btn btn-warning btn-sm" href="{php echo createWebUrl('shangjiaadd', array('shangjiaid' =>$item['id'],'themeid'=>$themeid));}" title="编辑"><i class="icon-edit"></i>编辑</a>
                      <a href="{php echo createWebUrl('shangjiaadd', array('op' => 'delete','themeid'=>$themeid, 'id' => $item['id']));}" style="width: 30px" class="btn btn-danger btn-sm" onclick="if(!confirm('参团记录相关的数据将全被删除，确定删除吗')) return false;"  title="删除" data-toggle="tooltip" data-placement="top"><i class="fa fa-times"> </i></a>
                    </td>
                </tr>
                {/loop}
            </tbody>
            </table>
        </div>
    {/if}
        {$pager}
    </div>
    </div>

<script type="text/javascript">
    function drop_confirm(msg, url){
        if(confirm(msg)){
            window.location = url;
        }
    }
</script>
